<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <input type="text" placeholder="身高(米)" v-model="height">
    <input type="text" placeholder="体重(公斤)" v-model="weight">
    <input type="button" value="测试" @click="f()">
    <h2>{{info}}</h2>
</div>

<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let v = new Vue({
        el: "body>div",
        data: {
            height:"",weight:"",info:""
        },
        methods:{
           f(){
               axios.get("/bmi?height="+v.height+"&weight="+v.weight).then(function (response){
                   v.info = response.data
               })
           }
        }
    })
</script>
</body>
</html>